<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/11
 * Time: 15:19
 */

namespace app\common\model;
use think\Db;

class Dc
{
    /**
     * 获取客服信息
     * @return array|false|\PDOStatement|string|\think\Collection
     */
    public function getService(){
        $redis=new Redis();
        $service=$redis->get('dc:service');
        if($service){
            return json_decode($service,true);
        }else{
            $service=Db::name('service')->select();
            if($service){
                $redis->set('dc:service',json_encode($service));
                return $service;
            }else{
                return [];
            }
        }
    }

}